package com.java.bean;

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class Item {
  private Long id;
  @NotBlank(message = "商品名称不可为空")
  private String name;
  @NotNull(message = "价格不可为空")
  private Double price;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date productionDate;
  @NotBlank(message="商品描述必填")
  private String description;
  @NotNull(message = "商品图片必填")
  private MultipartFile picFile;

  private String pic;

  private Date created;

}
